package com.southwind.springboottest.studykotlin.s2

import com.southwind.springboottest.studykotlin.s1.age
import com.southwind.springboottest.studykotlin.s2.KtBase29.webServiceloginAPI
import java.lang.Exception


//TODO 41.在Kotlin语法中异常处理与自定义异常特点

fun main() {
    try {
        var info: String? = null
        checkException(info)
        println(info!!.length)
    }catch (e:Exception){
//        e.printStackTrace();
        println("啊呀：$e")
    }

}
fun checkException(info:String?){
    info ?: throw CustomException()
}

class CustomException : IllegalArgumentException("你的代码太不严谨了")
